home *** CD-ROM | disk | FTP | other *** search
- /*
- Searches Amiga Active database on AACD
- $VER: 1.1 Search.awebrx (7.11.2000)
- (c) Neil Bothwick
-
- 1.1 - Uses "parse source" to get the path to the database
- */
-
- options results
- AWebPort = address()
-
- parse source . ' ' . ' ' . ' ' ScriptName ' ' .
- DBdir = left(ScriptName, lastpos('/', ScriptName))
-
- parse arg args
- call addlib('rexxsupport.library',0,-30,0)
- SearchStr = ''
- interpret args
- if SearchStr = '' then exit
- address command 'FlashFind >T:IndexSearch.results' DBdir'index "'SearchStr'" NH'
-
- call open(out,'T:IndexSearch.html','W')
- call writeln(out,'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">')
- call writeln(out,'<html><head><title>Search results</title></head><body bgcolor=white>')
- call writeln(out,'<h3 align="center">Result of searching for "<font color="red">'SearchStr'</font>"</h3>')
-
- if word(statef('T:IndexSearch.results'),2) = 0 then call writeln(out,'<h4 align="center">No matches found</h4>')
- else do
- call writeln(out,'<table align="center" border="0">')
- call writeln(out,'<tr><th width="80%">Title</th><th width="20%">Issue</th><tr>')
- call open(in,'T:IndexSearch.results','R')
- do until eof(in)
- line = readln(in)
- if line = '' then iterate
- parse var line File '|' IssueDate '|' Title '|' .
- parse var File IssueNum '-' .
- call writeln(out,'<tr align="left" valign="top"><td><a href="file://localhost/'DBdir||File'">'Title'</a></td>')
- call writeln(out,'<td align="center"><a href="file://localhost/'DBdir||'Issue'IssueNum'.html">'IssueDate'</a></td></tr>')
- end
- call close(in)
- call writeln(out,'</table>')
- end
-
- call writeln(out,'</body></html>')
- call close(out)
-
- 'Open "file://localhost/T:IndexSearch.html" reload'
-